home *** CD-ROM | disk | FTP | other *** search
- #include <Traps.h>
-
- Boolean TrapAvailable( short trapnum );
-
- #define GetNumToolBoxTraps (NGetTrapAddress(_InitGraf,ToolTrap) == \
- NGetTrapAddress(0xAA6E,ToolTrap)? 0x200 : 0x400)
-
- #define TRAP_TYPE(n) (n & 0x800 ? ToolTrap : OSTrap)
-
- Boolean TrapAvailable( short trapnum )
- {
- short ttype;
-
- ttype = TRAP_TYPE( trapnum );
- if (ttype == ToolTrap)
- {
- trapnum &= 0x7FF;
- if (trapnum >= GetNumToolBoxTraps)
- trapnum = _Unimplemented;
- }
- return (NGetTrapAddress( trapnum, ttype ) !=
- NGetTrapAddress( _Unimplemented, ToolTrap ));
- }